<?php

namespace App\Console;

use App\Http\Controllers\Admin\CrontabController;
use App\Http\Controllers\Api\OrderController;
use App\Models\Order;
use App\Models\Rebate;
use App\Models\User;
use App\Models\Flow;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //执行订单反润
        //$schedule->command('order:rebate')->everyMinute();
        //生成订单小程序码
//        $schedule->command('create:mpcode')->everyMinute();
        $schedule->call(function (CrontabController $controller){
            $controller->setOrderNotice();

        })->when(true);
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }

}
